<?php
/*
 * @Author: lokei
 * @Date: 2023-03-25 08:34:03
 * @LastEditors: lokei
 * @LastEditTime: 2023-03-25 17:34:19
 * @Description: 
 */

namespace App\Http\Controllers\Store\Pay;

use App\Common\Tools\ResultTool;
use App\Http\Controllers\Controller;
use App\Models\Store\StoreModel;
use Illuminate\Http\Request;

class PayController extends Controller {
    public function get(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('store_id'))->first();
        $res = ResultTool::success();
        $res['data']['mchid'] = $store->mchid;
        return $res;
    }

    public function set(Request $request) {
        $store = StoreModel::where('id', '=', $request->input('store_id'))->first();
        $store->mchid = $request->input('mchid');
        $store->save();
        $res = ResultTool::success();
        return $res;
    }
}